package com.framework.seedkit.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.framework.seedkit.R;
import com.framework.seedkit.base.BaseActivity;
import com.framework.seedkit.customwidget.imagePicker.ImagePickerAct;
import com.framework.seedkit.device.ble.BleDeviceAct;
import com.framework.seedkit.device.blueClass.DeviceListAct;
import com.framework.seedkit.device.nfc.NfcConnectAct;
import com.framework.seedkit.ui.encrypt.EncryptActivity;
import com.framework.seedkit.ui.refresh.PullRefreshActivity;
import com.framework.seedkit.ui.uiframe.vpagerSlip.NineGridViewAct;
import com.framework.seedkit.ui.uiframe.vpagerSlip.ViewPagerFlipActivity;

import butterknife.BindView;
/**
 * Created by yisong on 16/7/5.
 */
public class HomeAct extends BaseActivity implements View.OnClickListener {
    @BindView(R.id.vpager_flip_btn) Button vpager_flip_btn;
    @BindView(R.id.frag_frag_btn) Button frag_frag_btn;
    @BindView(R.id.slide_menu_btn) Button slide_menu_btn;
    @BindView(R.id.slide_menu_two_side_btn) Button slide_menu_two_side_btn;
    @BindView(R.id.encrypt_btn) Button encrypt_btn;
    @BindView(R.id.carrier_service_btn) Button carrier_service_btn;
    @BindView(R.id.xlistview_refresh_btn) Button xlistview_refresh_btn;
    @BindView(R.id.pull_refresh_btn) Button pull_refresh_btn;
    @BindView(R.id.swipe_refresh_btn) Button swipe_refresh_btn;
    @BindView(R.id.scan_btn) Button scan_btn;
    @BindView(R.id.img_select_btn) Button img_select_btn;
    @BindView(R.id.nine_gridview_btn) Button nine_gridview_btn;
    @BindView(R.id.blue_ble_btn) Button blue_ble_btn;
    @BindView(R.id.blue_class_btn) Button blue_class_btn;
    @BindView(R.id.nfc_btn) Button nfc_btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    protected void onResume() {
        super.onResume();
    }

    @Override
    public void initView() {
        setListener();
    }

    @Override
    public void initData() {

    }

    protected int getLayoutId() {
        return R.layout.act_main;
    }

    private void setListener() {
        //UI框架跳转的响应注册
        vpager_flip_btn.setOnClickListener(this);
        frag_frag_btn.setOnClickListener(this);
        slide_menu_btn.setOnClickListener(this);
        slide_menu_two_side_btn.setOnClickListener(this);
        xlistview_refresh_btn.setOnClickListener(this);
        pull_refresh_btn.setOnClickListener(this);
        swipe_refresh_btn.setOnClickListener(this);
        //工具类跳转的响应注册
        encrypt_btn.setOnClickListener(this);
        carrier_service_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startService(new Intent(HomeAct.this, MyCarrierService.class));
            }
        });
        scan_btn.setOnClickListener(this);
        img_select_btn.setOnClickListener(this);
        nine_gridview_btn.setOnClickListener(this);
        blue_ble_btn.setOnClickListener(this);
        blue_class_btn.setOnClickListener(this);
        nfc_btn.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = null;
        switch (view.getId()) {
            case R.id.vpager_flip_btn:
                intent = new Intent(this, ViewPagerFlipActivity.class);
                break;
            case R.id.frag_frag_btn:
                intent = new Intent(this, FragInFragAct.class);
                break;
            case R.id.slide_menu_btn:
                intent = new Intent(this, FragInFragAct.class);
                break;
            case R.id.slide_menu_two_side_btn:
                intent = new Intent(this, FragInFragAct.class);
                break;
            case R.id.encrypt_btn:
                intent = new Intent(this, EncryptActivity.class);
            case R.id.volley_btn:
//                intent = new Intent(this, EncryptActivity.class);
                break;
            case R.id.xlistview_refresh_btn:
                intent = new Intent(this, XListviewActivity.class);
                break;
            case R.id.pull_refresh_btn:
                intent = new Intent(this, PullRefreshActivity.class);
                break;
            case R.id.swipe_refresh_btn:
                intent = new Intent(this, SwipeRefreshLayoutAct.class);
                break;
            case R.id.scan_btn:
                intent = new Intent(this, ScanBarAct.class);
                break;
            case R.id.img_select_btn:
                intent = new Intent(this, ImagePickerAct.class);
                break;
            case R.id.nine_gridview_btn:
                intent = new Intent(this, NineGridViewAct.class);
                break;
            case R.id.nfc_btn:
                intent = new Intent(this, NfcConnectAct.class);
                break;
            case R.id.blue_ble_btn:
                intent = new Intent(this, BleDeviceAct.class);
                break;
            case R.id.blue_class_btn:
                intent = new Intent(this, DeviceListAct.class);
                break;
            default:
                break;
        }

        if (intent != null) {
            startActivity(intent);
        }
    }
}
